import Vue from 'vue'
import Vuex from 'vuex'
import storages from '@/until/localStorage';

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    configAxiosURL: '',
    defaultActive_: storages.getItem('setActive') === undefined ? null : storages.getItem('setActive'),
    topBarArr: []
  },
  getters: {
  },
  mutations: {
    setActive(state,n){
      state.defaultActive_ = n
    },
    setTopBar(state,n) {
      state.topBarArr = JSON.parse(n)
      // console.log(state.topBarArr);
      
    },
    clearStoreData(state){
      state.defaultActive_ = null
      state.topBarArr = []
    },
    setconfigAxiosURL(state, n){
      state.configAxiosURL = n
    }
  },
  actions: {
  },
  modules: {
  }
})
